package com.mz.mattress.client.api.biz;

import com.mz.mattress.api.common.Result;
import com.mz.mattress.client.api.resp.DeviceStatusResp;
import com.mz.mattress.client.service.MattressMsgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/mattressMsg")
@Slf4j
public class MattressMsgController {

    @Autowired
    private MattressMsgService mattressMsgService;

    @GetMapping("/deviceStatus")
    public Result<DeviceStatusResp> deviceStatus(@RequestParam String timesId) {
        if (timesId == null || "null".equals(timesId)) {
            log.info("timesId_is_null");
            return Result.ok();
        }
        return mattressMsgService.deviceStatus(Integer.valueOf(timesId));
    }

}
